package com.wangcanxuan.www.dao.mapper;

import com.wangcanxuan.www.annotation.orm.ReturnType;
import com.wangcanxuan.www.annotation.orm.Select;
import com.wangcanxuan.www.entity.po.Tribe;
import com.wangcanxuan.www.proxy.constants.ReturnDataType;

import java.util.List;

/**
 * 部落类Mapper
 *
 * @author HHLJ
 * @date 2022/04/01
 */
public interface TribeMapper extends BaseMapper<Tribe>{

    /**
     * 选择所有部落营地列表
     *
     * @param camp      营
     * @param pageCount 页面数
     * @return {@link List}<{@link Tribe}>
     */
    @Select(sql = "SELECT * FROM `tribe` WHERE camp = ? ORDER BY combat_power DESC LIMIT ?,10 ")
    @ReturnType(returnType = ReturnDataType.LIST)
    List<Tribe> selectAllCampTribeList(int camp,int pageCount);

    /**
     * 选择搜索部落列表
     *
     * @param tribeName 部落的名字
     * @param campId    营id
     * @param pageCount 页面数
     * @return {@link List}<{@link Tribe}>
     */
    @Select(sql = "SELECT * FROM `tribe` WHERE camp = ? AND tribe_name like ? ORDER BY combat_power DESC LIMIT ?,10")
    @ReturnType(returnType = ReturnDataType.LIST)
    List<Tribe> selectSearchTribeList(int campId,String tribeName,int pageCount);
}
